import request from '@/utils/request'

// 创建仓储物料表	
export function createMaterial(data) {
  return request({
    url: '/storage/material/create',
    method: 'post',
    data: data
  })
}

// 更新仓储物料表	
export function updateMaterial(data) {
  return request({
    url: '/storage/material/update',
    method: 'put',
    data: data
  })
}

// 删除仓储物料表	
export function deleteMaterial(id) {
  return request({
    url: '/storage/material/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除仓储物料表	 */
export function deleteMaterialList(ids) {
  return request({
    url: `/storage/material/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得仓储物料表	
export function getMaterial(id) {
  return request({
    url: '/storage/material/get?id=' + id,
    method: 'get'
  })
}

// 获得仓储物料表	分页
export function getMaterialPage(params) {
  return request({
    url: '/storage/material/page',
    method: 'get',
    params
  })
}
// 导出仓储物料表	 Excel
export function exportMaterialExcel(params) {
  return request({
    url: '/storage/material/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}